//
//  EvaluateSectionFooterView.m
//  BaseProject
//
//  Created by 王洋 on 2020/12/18.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "EvaluateSectionFooterView.h"

@implementation EvaluateSectionFooterView

- (void)fillWithModel:(CommunityInteractionModel *)model type:(EvaluateSectionFooterType)type {

    self.timeLab.text = model.createTime;
//    self.countLab.text = [NSString stringWithFormat:@"评论%@·赞%@",model.likes];

    switch (type) {
        case EvaluateSectionFooter_myEva:{
            
            [self.actionBtn setTitle:[NSString stringWithFormat:@"评论%ld·赞%ld",model.replyCount,model.likes] forState:UIControlStateNormal];
            [self.actionBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
            
        } break;
        case EvaluateSectionFooter_reply:{
            
            [self.actionBtn setImage:[UIImage imageNamed:@"hd_reply"] forState:UIControlStateNormal];
            [self.actionBtn setTitle:@" 回复" forState:UIControlStateNormal];
            
            switch (model.type) {
                case 1:{
                    self.actionBtn.hidden = NO;
                } break;
                case 2:{
                    self.actionBtn.hidden = NO;
                } break;
                case 3:{
                    self.actionBtn.hidden = YES;
                } break;
                default:
                    break;
            }
        } break;
        case EvaluateSectionFooter_thumb:{
            
            self.actionBtn.hidden = YES;

        } break;
        default:
            break;
    }
    
}

- (IBAction)handleAction:(id)sender {
    if (self.EvaluateSectionFooterViewBlock) {
        self.EvaluateSectionFooterViewBlock();
    }
}


@end
